{include file="common/_meta" /}
<title></title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>订单管理 <span class="c-gray en">&gt;</span> 订单列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c">
	<form class="Huiform" method="get" action="">
		状态：
		<span class="select-box inline">
		<select name="status" class="select">
			<option value="">全部</option>
			
			<option value="1">已完成</option>
		</select>
		</span>
		日期范围：
		<input type="text" class="input-text Wdate" name="start" id="countTimestart" onfocus="selecttime(1)" value="" size="17" class="date" readonly style="width:140px;"> 
		- 
		<input type="text" class="input-text Wdate" name="end" id="countTimeend" onfocus="selecttime(2)" value="" size="17"  class="date" readonly style="width:140px;">
		<input type="text" class="input-text" style="width:250px" placeholder="" id="" name="keywords" value="{$Think.get.keywords|default=''}">
		<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
	</form>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"><span class="r">共有数据：<strong>{$list->total()}</strong> 条</span> </div>
	<div class="mt-20">
	<table class="table table-border  table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="25"><input type="checkbox" name="" value=""></th>
				<th>订单编号</th>
				<th>买家账号</th>
				<th>商家信息</th>
				<th>订单金额</th>
				<th>消耗金币</th>
				<!-- <th>订单详情</th> -->
				<th>支付状态</th>
				
				<!-- <th>更新时间</th> -->
				<th>下单时间</th>
				<th>订单备注</th>
				<!-- <th>订单状态</th> -->
				<!-- <th>系统确认</th> -->
				<th>操&nbsp;&nbsp;&nbsp;作</th>
			</tr>
		</thead>
		<tbody>
			{volist name="list" id="vo" key="k"}
				<tr class="text-c">
					<td><input type="checkbox" value="1" name=""></td>
					<td>{$vo.order_no}</td>
					<td>{$vo.name}<br/>{$vo.tel}</td>
					<td>{$vo.shop_name}<br/>{$vo.shop_tel}</td>
					<td>{$vo.order_money}</td>
					<td>{$vo.order_coin}</td>
					<!-- <td><a href="javascript:;" onclick="showDetail({$vo.id})">[点击查看]</a></td> -->
					<td style="color: red;">
						{if condition="$vo['payment'] eq 1"} 分红账户支付
						{elseif condition="$vo['payment'] eq 2"} 微信支付
						{elseif condition="$vo['payment'] eq 3"} 分销账户支付
						{else/} 未支付
						{/if}
					</td>
					<!-- <td >{$vo.update_time}</td> -->
					<td>{$vo.create_time}</td>
					<!-- <td>{$vo.note}</td> -->
					<td class="td-status">
						{if condition="$vo.status eq 1"}
							<span class="label label-success radius">已完成</span>
						{elseif condition="$vo.is_pay eq 1"/}
							{if condition="$vo['shipping_status'] eq 1"}
							<span class="label label-secondary radius">待收货</span>
							{else/}
							<span class="label label-default radius">待发货</span>
							{/if}
						{else/}
							<span class="label label-danger radius">待支付</span>
						{/if}
					</td>
					<!-- <td><input class="btn btn-success radius" type="button" value="完成订单" onclick="subOrder({$vo.id})"></td> -->
					<td class="td-manage" width="10%">
						<a href="javascript:;" onclick="showDetail({$vo.id})">[点击查看]</a>
					</td>
				</tr>
			{/volist}
		</tbody>
	</table>
		<div class="pages" style="margin:20px;float: right; ">{$list->render()}</div>
	</div>
</div>
{include file="common/_footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript">
$('select[name="status"]').val({$Request.get.status});
function selecttime(flag){
    if(flag==1){
        var endTime = $("#countTimeend").val();
        if(endTime != ""){
            WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',maxDate:endTime})}else{
            WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})}
    }else{
        var startTime = $("#countTimestart").val();
        if(startTime != ""){
            WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:startTime})}else{
            WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})}
    }
 }

function showDetail(id){
	var url = "{:url('Order/orderDetail')}?id="+id;
	layer_show('订单详情',url);
}

function optOrder(obj,id,type){
	// 发货
	if(type){
		$.post("{:url('Order/optOrder')}",{id:id,type:type}).success(function(data){
			layer.msg(data.msg);
			if(data.code){
				$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">发货中</span>');
				$(obj).remove();
			}
		});
	}
}

</script> 
</body>
</html>